<?php 
session_start();
require_once("include/authen.php");
require_once("include/ui.php");
if ($_POST['view']=='product'){
	echo headerPage("Point of Sale [ Product ]");
	$colspan=7;
}else{
	echo headerPage("Point of Sale [ Customer ]");
	$colspan=8;
}
 
?>

<SCRIPT src="js/js_poshistory_d.js"></SCRIPT> 
 <script>
$(function() {

	$( "#txtDateFrom" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
				
	$( "#txtDateTo" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
		
	$("#btnPrint").live('click',function(){
		$("#normal-screen").hide();
		$("#page-header").hide();
		$("#searchdata").hide();
		$(".toolbar-box").hide();
		$("#foolter_table").hide();
		$("#leftboder").hide();
		$("#rightboder").hide();
		window.print();
		
		$("#normal-screen").show();
		$("#page-header").show();
		$("#searchdata").show();
		$(".toolbar-box").show();
		$("#foolter_table").show();
		$("#leftboder").show();
		$("#rightboder").show();
	});	
});
</script>
<FORM name="Act" id="Act"  action="pos_history.php" method="post"> 
<INPUT type=hidden value="<?php echo $_POST['ipos'];?>" id="ipos" name="ipos"> 
<INPUT type=hidden value="<?php echo $_POST['ibr'];?>" id="ibr" name="ibr"> 
<INPUT type=hidden value="<?php echo $_POST['view'];?>" id="view" name="view"> 
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
 
    <td width="10" id='leftboder' style='border-left:2px solid #facb0c;'>&nbsp;</td>
    <td width="1004" valign="top">
        <div class="content-box">
            <div Class="toolbar-box">   
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                 </div>
                 <div class="m">
                    <div class="toolbar">
                        <table class="toolbar">
                        <tr>
							<td><a href="javascript:void('0');" id="btnBack">
								<span class="icon_back"></span>Back
								</a>
							</td>
							 <td>
								<a href="javascript:void('0');" title="Print" id="btnPrint">
								<span class="icon_Print"></span>Print
								</a>
							</td>							
						</tr>
                        </table>
                    </div>
                      <div class="header" style="background-image: url(images/todo.png);">
					  <?php if ($_POST['view']=='product'){?>
						History - Point of Sale [ Product ]
						<?php }else{?>
						History - Point of Sale [ Customer ]
						<?php }?>
                      </div>
                <div class="clr"></div>
                 </div>
                 <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                 </div>
            </div>
               <div id="element-box">
                <div class="t">
					<div class="t">
						<div class="t"></div>
					</div>
				</div>
                <div class="m">
				  <table width="100%">
                    <tr>
					<td width="30%"  class="fontSearch" style="padding-left:20;font-weight:bold;padding-bottom:10px;">
					
					<label for="name">&nbsp;&nbsp;Date : </label>
										<span id="iDate" style="font-weight:normal;"></span>
								</td>
                        <td width="60%" colspan="2" class="fontSearch" style="padding-left:20;font-weight:bold;padding-bottom:10px;">
									<div style="display:none">	<label for="name">&nbsp;&nbsp;Branch : </label>
										<span id="iBranch" style="font-weight:normal;"></span></div>
								</td>
                    </tr>			 
					    <tr>
                        <td width="30%" colspan="1" class="fontSearch" style="padding-left:20;font-weight:bold;padding-bottom:10px;"><label for="name">&nbsp;&nbsp;Total Amount : </label>
											<span id="iAmount" style="font-weight:normal;"></span></td>
                    
						 
                        <td width="30%" colspan="1" class="fontSearch" style="padding-left:20;font-weight:bold;padding-bottom:10px;"><label for="name">&nbsp;&nbsp;Total Payment : </label>
											<span id="iPayment" style="font-weight:normal;"></span>
								</td>
											
                        <td width="30%" colspan="1" class="fontSearch" style="padding-left:20;font-weight:bold;padding-bottom:10px;"><label for="name">&nbsp;&nbsp;Remain Amount : </label>
											<span id="iRemain" style="font-weight:normal;color:red"></span>
								</td>
                    </tr>						
 
						 <tr><td colspan="3"></tr>
                 </table>
                    <table cellspacing="1" id="resultData" class=list>
                    <thead>
                       <tr>
								<th width="4%" >No.</th>
								 <?php if ($_POST['view']=='product'){?>
									<th class="title" width="20%" >Product Name</th>								 
									<th class="title" width="15%" > Type </th>								 
									<th class="title" width="15%" >Amount</th>	
									<th class="title" width="15%" >Price</th>	
									<th class="title" width="15%" >Discount</th>	
									<th class="title" width="15%" >Total</th>	
								 <?php }else{?>
									<th class="title" width="30%" >Customer Name</th>
									<th  class="title" width="10%"  nowrap="nowrap">Amount</th>
									<th  class="title" width="10%"  nowrap="nowrap">Discount</th>
									<th  class="title" width="10%"  nowrap="nowrap">Total Net</th>
									<th class="title" width="15%"   nowrap="nowrap">Pay Type</th>
									<th  class="title" width="10%"  nowrap="nowrap">Payment</th>
									<th  class="title" width="10%"  nowrap="nowrap">Remain</th>
								<?php }?>
                      </tr>
                    </thead>
                   <tbody>
                   </tbody>
                   <tfoot>
                         <tr>
							<td colspan="<?php echo $colspan?>">
									<div class="boxfooter">
									<div id="paging_btn">  </div> 
								 <div class="totalpage">Total : <span id="rowCount">0</span>&nbsp;&nbsp;rows</div>
								 </div>
							</td>
                         </tr>
                     </tfoot>
                    </table>
                  <div class="clr"></div>
                </div>
                 <div class="b"><div class="b"><div class="b"></div></div></div>
                 <div class="clr"></div>
                </div> <!-- elementbox-->
        </div>
    </td>
    <td width="10" id='rightboder' style='border-right:2px solid #facb0c;'>&nbsp;</td>
 
  </tr>
</table>
 </FORM>
<?php 
echo footer();
?>